Skip to content

fix: replace lodash with es-toolkit #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

manudeli
Copy link

@manudeli manudeli commented Jun 6, 2025

What:

Replaced usages of lodash utility functions with their equivalents from es-toolkit, and removed lodash from dependencies. Storybook also use es-toolkit

Why:

es-toolkit offers modern, modular alternatives that align with the library's lightweight philosophy.

How:

Identified and replaced individual lodash imports with equivalent functions from es-toolkit/compat.

Adjusted imports accordingly.

Updated unit tests to confirm behavior remains unchanged.

Removed lodash from package.json.

Checklist:

  • Documentation
  • Tests
  • Updated Type Definitions
  • Ready to be merged

@manudeli manudeli marked this pull request as ready for review June 6, 2025 07:07
@okinawaa
Copy link

@gnapse Hello.
I'm sorry while you're busy.
Can you check this PR? The context is well written in the description.

Copy link
Contributor

@wojtekmaj wojtekmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and it looks like choosing compat function is the right choice here. From what I see, every isEqualWith call is being made with a third argument being compareArraysAsSet util, which might return undefined when we're not comparing two arrays, which would trigger the compat behavior that comes after this line evaluates to false: https://github.com/toss/es-toolkit/blob/main/src/compat/predicate/isEqualWith.ts#L48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants